home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / WINSHOES.ZIP / POP3.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-03-20  |  1.4 KB  |  69 lines

  1. unit Pop3;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Winshoes;
  8.  
  9. type
  10.   TformPOP3 = class(TForm)
  11.     pop: TPBE_sPOP3;
  12.     Label1: TLabel;
  13.     editHost: TEdit;
  14.     Label2: TLabel;
  15.     editUsername: TEdit;
  16.     Label3: TLabel;
  17.     editPassword: TEdit;
  18.     Label4: TLabel;
  19.     editMsgNo: TEdit;
  20.     butnRetrieve: TButton;
  21.     memoMessage: TMemo;
  22.     lablStatus: TLabel;
  23.     procedure butnRetrieveClick(Sender: TObject);
  24.     procedure popStatus(const sMessage: String);
  25.   private
  26.   public
  27.   end;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure TformPOP3.butnRetrieveClick(Sender: TObject);
  34. var
  35.     strm: TFilestream;
  36. begin
  37.     try
  38.     with pop do begin
  39.       Host := editHost.Text;
  40.       UserID := editUsername.Text;
  41.       Password := editPassword.text;
  42.       Connect;
  43.       butnRetrieve.Caption := '..Busy..';
  44.       try
  45.         strm := TFilestream.Create('c:\tempwins.txt', fmCreate);
  46.         with strm do
  47.           try
  48.             retrieve(StrToInt(editMsgNo.text), strm, strm);
  49.           finally
  50.             free;
  51.           end;
  52.         memoMessage.lines.LoadFromFile('c:\tempwins.txt');
  53.       finally
  54.           Disconnect;
  55.       end;
  56.     end;
  57.   except
  58.       on e: Exception do Application.ShowException(E);
  59.   end;
  60.   butnRetrieve.Caption := '&Retrieve';
  61. end;
  62.  
  63. procedure TformPOP3.popStatus(const sMessage: String);
  64. begin
  65.     lablStatus.Caption := sMessage;
  66. end;
  67.  
  68. end.
  69.